package com.pen.interfece.mapper;

import com.github.pagehelper.Page;
import com.pen.interfece.pojo.dto.AdminLoginDTO;
import com.pen.interfece.pojo.dto.AdminPageQueryDTO;
import com.pen.interfece.pojo.entity.Admin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AdminMapper {

    @Select("select * from user where account = #{account}")
    Admin getByAccount(AdminLoginDTO adminLoginDTO);
    @Insert("insert into admin(account, password, admin_name, phone, sex, job) " +
            "values"+
            "(#{account},#{password},#{adminName},#{phone},#{sex},#{job})")
    void save(Admin admin);
    @Delete("delete from admin where id = #{id}")
    void deleteById(Long id);

    void update(Admin admin);

    Page<Admin> pageQuery(AdminPageQueryDTO adminPageQuerydto);
}
